﻿#coding:utf-8

import wx
import wx.aui

from widgets import *
from objectCollection import *

class ModeLayoutControl():
	
	def __init__(self,mode):
		self.mode = mode
		
	def writeConsole(self):
		pass
	
	
class ModeLayoutModel():
	
	def __init__(self,container):
		self.container = container
		
		self.sandbox = None
		self.visu = None
		
		self.console = None
		self.objectInsp = None
		
		self.toolbox = None
	
	def getViewBox(self):
		self.sandbox = SandBoxPanel(self.container,size=(300,300))
		self.sandbox.SetDropTarget(PanelTarget(self.sandbox,"ToolBoxObject"))
		self.sandbox.SetBackgroundColour("white")		
		
		self.visu = wx.Panel(self.container,-1,size=(300,300))
		
		nt_view = wx.aui.AuiNotebook(self.container,-1,size=(300,300))
		nt_view.AddPage(self.sandbox,"Sandbox")
		nt_view.AddPage(self.visu,u"Visualização")
		
		return nt_view
	
	def getToolBox(self):
		pass
	
	def getInfoBox(self):
		self.console = wx.TextCtrl(self.container, -1, 'Console',
									  wx.DefaultPosition, wx.Size(200,150),
									  wx.NO_BORDER | wx.TE_MULTILINE)
		
		self.objectInsp = wx.Panel(self.container,-1,size=(300,300))
		self.objectInsp.SetBackgroundColour("blue")		

		nt_info = wx.aui.AuiNotebook(self.container,-1,size=(300,300))
		nt_info.AddPage(self.console,"Console")
		nt_info.AddPage(self.objectInsp,"Object Insp.")
		
		return nt_info
	
	
class EletrostaticaLayoutModel(ModeLayoutModel):
	
	def getToolBox(self):
		self.toolbox = wx.Panel(self.container,-1,size=(150,400))

		t1 = PanelSource(self.toolbox,ToolBoxObject( RectSurfacePotential() ),"ToolBoxObject")	
		t2 = PanelSource(self.toolbox,ToolBoxObject( RectSurfacePotential() ),"ToolBoxObject")	
		
		sizer = wx.BoxSizer(wx.VERTICAL)
		sizer.Add(t1)
		sizer.Add(t2)
		
		self.toolbox.SetSizer(sizer)
		self.toolbox.Fit()
		
		return self.toolbox		
	
	
	